Repository navigation
fix(ai): mask credentials in Gemini tool definitions - #1304
Conversation
$ai_tools redaction only matched tools with type "mcp", so Gemini tools sent their retrieval, Google Maps, Parallel search, and MCP server credentials unmasked. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SDK performance: posthog-pythonBenchmarks completed. No changes flagged for review. Flags require at least a 5% change in the median and all six pairs agreeing on direction. This is a noise filter, not proof of a performance change or a CI gate. View all results
Values are medians of paired measurements. Not flagged does not mean unchanged. Unavailable means a measurement could not be provided, not zero. Estimated allocation measurements retain their instrumentation uncertainty. RSS measures the whole process, not just SDK allocations; observed peaks are sampled checkpoints. Paired ranges in the diagnostics describe variability, not confidence intervals. Each shard uses its own runner; compare Before PR against With PR within a row, not across shards. Compared 102 metric rows; 102 rows shown in all results. Omitted or shortened data remain in |
There was a problem hiding this comment.
PostHog Review · Standard · reviewed c67d418: 1 Must fix.
New pushes to this pull request won't start an automatic review. Comment @posthog review to review new changes.
See this review and its findings in PostHog Review. Comment @posthog review --deep for a Deep review. A Deep review takes longer and looks deeper than a Standard review.
A fixed list of tool fields missed exa_ai_search, which google-genai 2.33 adds. Read the tool fields from the installed SDK and mask credential keys under all of them except function_declarations. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- mask Gemini tools with extra keys, nested models, tuple configs, and Tool subclasses - look up google-genai in sys.modules instead of importing it on every provider's capture path Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
💡 Motivation and Context
$ai_tools, even in privacy mode.type: "mcp", and Gemini tools have notypefield.retrieval.external_apiauth,google_maps.auth_config,exa_ai_search.api_key, andmcp_serversheaders.Changes
api_key,api_auth,auth_config, andheadersin a Gemini tool config now reads[REDACTED].api_keysurvives.💚 How did you test it?
test_privacy_mode.pycovers each credential field, as a model and as a dict. Every row fails without the fix.📝 Checklist
If releasing new changes
sampo addto generate a changeset file (wrote.sampo/changesets/gemini-tool-credentials.mdby hand in the same format)🤖 Agent context
Autonomy: Human-driven (agent-assisted)
claude-opus-5-5) wrote the change. Skills:writing-pr-descriptions.uv.lockpins.🤖 Generated with Claude Code